package com.nanyang.tms.api.dto.request.saleproduct.add;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * <p>Description:(销售产品计重规则表)</p>
 *
 * @author lv
 * @date 2022年11月12日 下午05:06:46
 * @Copyright Copyright (c) 2020 www.nanyang.cn Inc. All rights reserved.
 */
@Data
public class SaleProductWeightRuleAddRequest implements Serializable {
    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = 1L;


    /**
     * 国家编码
     */
    @Length(max = 3, message = "countyCode长度需小于3个字符")
    private String countyCode;

    /**
     * 国家名称
     */
    @Length(max = 30, message = "countyName长度需小于30个字符")
    private String countyName;

    /**
     * 城市编码
     */
    @Length(max = 32, message = "cityCode长度需小于32个字符")
    private String cityCode;

    /**
     * 城市名称
     */
    @Length(max = 50, message = "cityName长度需小于50个字符")
    private String cityName;

    /**
     * 货物类型编码
     */
    @NotEmpty(message = "货物类型编码不能为空")
    @Length(max = 20, message = "cargoTypeCode长度需小于20个字符")
    private String cargoTypeCode;

    /**
     * 货物类型名称
     */
    @NotEmpty(message = "货物类型名称不能为空")
    @Length(max = 30, message = "cargoTypeName长度需小于30个字符")
    private String cargoTypeName;

//    /**
//     * 起始邮编
//     */
//    @Length(max = 10, message = "zipCodeStart长度需小于10个字符")
//    private String zipCodeStart;
//
//    /**
//     * 截至邮编
//     */
//    @Length(max = 10, message = "zipCodeEnd长度需小于10个字符")
//    private String zipCodeEnd;

    /**
     * 材积系数
     */
    @NotNull(message = "材积系数不能为空")
    @Digits(integer = 9, fraction=2, message = "volumeFactor格式不正确")
    @DecimalMin(value = "0.00", message = "volumeFactor格式不正确")
    private BigDecimal volumeFactor;

    /**
     * 条件表达式
     */
    @NotEmpty(message = "条件表达式不能为空")
    @Length(max = 500, message = "conditionExpression长度需小于500个字符")
    private String conditionExpression;

    /**
     * 重量表达式
     */
//    @NotEmpty(message = "重量表达式不能为空")
//    @Length(max = 50, message = "weightExpression长度需小于50个字符")
//    private String weightExpression;
}